import requests
from lxml import etree

git_urls = {
    '高凡启': 'https://gitee.com/gfanqi/meiduo_project',
    '刘勇': 'https://gitee.com/liu_yong_123/mido_mall_project',
    '魏名超': 'https://gitee.com/weimingchao0525/meidoshangcheng',
    '欧阳盛涛': 'https://gitee.com/ouyang_shengtao/oyst',
    '王冠富': 'https://gitee.com/wang_guan_fu/git',
    '周锦生': 'https://gitee.com/Jinwk/meiduo_project02',
    '吴碧伟': 'https://gitee.com/yemoit/meiduo_project',
    '欧阳兆辉': 'https://gitee.com/oyzhaohui/meiduo_project02',
    '杨德城': 'https://gitee.com/mascleyangdecheng/meiduo_project',
    '李廷坚': 'https://gitee.com/unfamiliar_talk/Knowledge_has_no_limit',
    '田大江': 'https://gitee.com/tdj153/meiduo_project02',
    '邓鹏飞': 'https://gitee.com/lewanmt/meiduo_project',
    '黄振华': 'https://gitee.com/mashachi/meiduo_project02',
    '吴会粤': 'https://gitee.com/wu_hui_yue/meiduo_project02',
    '谢池升': 'https://gitee.com/xiechisheng/meiduo_project',
    '余奕斌': 'https://gitee.com/xiaoyu555/meiduo_project',
    '张嘉浚': 'https://gitee.com/zhang_jia_jun1/meiduo_project02',
    '林剑伟': 'https://gitee.com/kvsummer/meiduo_project',
    '王亚军': 'https://gitee.com/morning_water/mei_do',
    '陈乾坤': 'https://gitee.com/cqkitgit/cqk_meiduo',
    '占家伟': 'https://gitee.com/general_merchandise_dian/meiduo_project02',
    '郑国坤': 'https://gitee.com/git_ccw/meiduo_project01',
    '林渝淇': 'https://gitee.com/git_linzhu/meiduo_project01',
    '许成': 'https://gitee.com/bassruby/meiduo_project02',
    '阳冬平': 'https://gitee.com/yang_peak/meiduo_project02',
    '周方超': 'https://gitee.com/zhou_fang_chao/meiduo_project02',
    '邹海珍': 'https://gitee.com/zouhai44/meiduo_project02',
    '张传胜': 'https://gitee.com/ordinary_world/meiduo',
    '陈广润': 'https://gitee.com/cgrun/meiduo_project',
    '姚振宇': 'https://gitee.com/yaozy93/meiduo_project',
}

for name, url in git_urls.items():
    try:
        response = requests.get(url)
        html = etree.HTML(response.text)
        time_data = html.xpath('//*[@id="git-project-info"]/div[1]/span')
        content_data = html.xpath('//*[@id="git-project-info"]/div[1]/a[2]')
        print('% 3s,最近更新时间:%s, 最近更新内容:%s' %
              (name, time_data[0].attrib['datetime'], content_data[0].attrib['title']))
    except Exception as e:
        print('%s,git信息获取失败' % name)
